/*
 * @描述:
 * @作者: 约訂
 * @Date: 2024-06-12 10:09:34
 * @LastEditTime: 2024-12-04 10:34:42
 * @修改人员: 约訂
 */
import Vue from "vue";

import Cookies from "js-cookie";
import Element from "element-ui";

// global css
import "normalize.css/normalize.css";
import "./assets/styles/element-variables.scss";
import "./assets/styles/index.scss";
import "./assets/styles/public.scss";
import "./assets/styles/variables.scss";

import "./assets/icons"; // icon
import "./router/index"; //
import "./assets/icons/svgAli/iconfont";

import directives from "./directives";
import App from "./App";
import store from "./store";
import router from "./router/routers";
import Pagination from "./components/Pagination";
import permission from "./components/Permission";
import ContextMenu from "./components/ContextMenu";
import FlexContainer from "./components/FlexContainer";
import AddressSelector from "./components/AddressSelector";
import MDialog from "./components/Dialog";
import Vant from "vant";
import "vant/lib/index.css";
import { Dialog } from "vant";
// ...
// import VxeUI from "vxe-pc-ui";
// import "vxe-pc-ui/lib/style.css";
// ...

import VxeUI from "vxe-pc-ui";
import "vxe-pc-ui/lib/style.css";
import VxeUITable from "vxe-table";
import "vxe-table/lib/style.css";
// ...

Vue.use(VxeUI);
Vue.use(VxeUITable);
// ...
/**vxe-table */

// 全局方法挂载

// 全局组件挂载
Vue.component("Pagination", Pagination);
Vue.component("ContextMenu", ContextMenu);
Vue.component("FlexContainer", FlexContainer);
Vue.component("MDialog", MDialog);
Vue.component("AddressSelector", AddressSelector);
// 全局注册
Vue.use(Dialog);
Vue.use(permission);
Vue.use(directives);
// Vue.use(VxeUI);

Vue.use(Element, {
  size: Cookies.get("size") || "mini" // set element-ui default size
});
// Vue.use(VXETable);
Vue.use(Vant);
Vue.directive("preventReClick", {
  inserted(el, binding) {
    el.addEventListener("click", () => {
      if (!el.disabled) {
        el.disabled = true;
        setTimeout(() => {
          el.disabled = false;
        }, binding.value || 2000);
      }
    });
  }
});

Vue.config.productionTip = false;
new Vue({
  el: "#app",
  router,
  store,
  render: h => h(App)
});
